package com.wealth.scsj.p_app.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.xlhratingbar_lib.XLHRatingBar;
import com.wealth.scsj.p_app.R;
import com.wealth.scsj.p_app.bean.EvaluateLabelsBean;
import com.wealth.scsj.p_app.bean.OrderIndexBean;

import java.util.List;

/**
 * 个人中心-评论列表adapter
 */

public class EvaluateListAdapter extends BaseQuickAdapter<EvaluateLabelsBean.EvaluateListBean, BaseViewHolder> {

    public EvaluateListAdapter(List data) {
        super(R.layout.item_evaluate_list_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, EvaluateLabelsBean.EvaluateListBean item) {

        helper.setText(R.id.evaluate_user_name, item.getUser_name());
        helper.setText(R.id.star_num_tv, item.getUser_evaluate_points());
        helper.setText(R.id.evaluate_data_tv, item.getEvaluate_data());
        String starnum =item.getUser_evaluate_points();
        ((XLHRatingBar)helper.getView(R.id.index_comm_rb)).setCountSelected(Integer.parseInt(starnum.substring(0,starnum.indexOf("颗"))));

    }
}
